package com.aaa.day1104.demo2;

import java.util.stream.Stream;

/**
 * @Description:
 * @author:LiWei
 * @date:2022年11月06日13:44
 */
public class Test3 {
        public static void main(String[] args) {
            String[] arr1 = { "a", "b", "c", "d" };
            String[] arr2 = { "d", "e", "f", "g" };
            Stream<String> stream1 = Stream.of(arr1);
            Stream<String> stream2 = Stream.of(arr2);

            //合并流
            //Stream.concat(stream1,stream2).forEach(System.out::println);

            //去重
            Stream.concat(stream1,stream2).distinct().forEach(System.out::println);

            //获取前n个元素
            //Stream.concat(stream1,stream2).limit(5).forEach(System.out::println);

            //跳过前n个元素
            //Stream.concat(stream1,stream2).skip(2).forEach(System.out::println);
        }
}


